﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sunboxsoft.Common;

namespace Sunboxsoft.ASMS.Client.Domain.Service
{
    public class LoginService
    {
        public SingleResult<BasesWebRef.Account> Login(string account, string password)
        {
            using (BasesWebRef.BasesWebService service = RemoteInfo.CreateBasesWebService())
            {
                BasesWebRef.SingleResultOfAccount result = service.Login(account, password);
                if (result.IsSuccess)
                {
                    return new SingleResult<BasesWebRef.Account>(result.Data);

                }
                return new SingleResult<BasesWebRef.Account>(result.ErrorCode, result.Message);
            }
        }
    }
}
